home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18163 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: isonews.bbn.hp.com!hpbblb!news
  2. From: Matthias Dittrich <matti>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Templates as the type of a template
  5. Date: 18 Apr 1996 16:55:03 GMT
  6. Organization: Hewlett-Packard Co.
  7. Message-ID: <4l5s57$1kc@hpbblb.bbn.hp.com>
  8. References: <316D1587.167EB0E7@kainos.com>
  9. NNTP-Posting-Host: trabant.bbn.hp.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
  14. X-URL: news:316D1587.167EB0E7@kainos.com
  15.  
  16. Andrew Palmer <a.palmer@kainos.com> wrote:
  17. >Hello,
  18. >
  19. >  I'm using Sun's CC compiler from Sparcworks 3.0.1 and I'm having a
  20. >little trouble passing a template class as the type of another template
  21. >class.
  22. >
  23. >  I have one template class called "list" and I can use "list<int> foo"
  24. >fine.
  25. >  I have another template class called "vector" and I can use
  26. >"vector<int> bar;" fine as well.
  27. >
  28. >  But I don't seem to be able to have a list of vectors of type int,
  29. >e.g. "list<vector<int>> foobar;" doesn't work.
  30.                        ^
  31. Insert a blank here:
  32. list<vector<int> >
  33. In the other case the compiler assumes this is a shift operator.
  34. >
  35. >  I can get round the problem by "typedef vector<int> iVector;
  36. >list<iVector> foobar;"
  37. >
  38. >  Am I doing something wrong in the syntax or is it just one of those
  39. >things that doesn't work?
  40. >
  41.  
  42. -- 
  43. email (at work): matti@trabant.bbn.hp.com
  44.  
  45.